package oj;
import java.util.*;
public class Day31S {
        private static boolean isLeapYear(int y){
            return (y%4==0 && y%100!=0) || (y%400==0);
        }

        private static final int[] days={31,28,31,30,31,30,31,31,30,31,30,31};
        //返回这年过了多少天了
        private static int nDays(int y,int m,int d){
            int n=d;
            for(int i=0;i<m-1;i++){
                n+=days[i];
            }
            if(m>2 && isLeapYear(y)){
                n++;
            }
            return n;
        }
        //传入年月日，从公元前1年12月31日开始过了多少天了
        private static int diff(int y,int m,int d){
            return (y-1)+(y-1)/4+(y-1)/400-(y-1)/100+nDays(y,m,d);
        }
        //根据n,m,d求出星期几
        private static int week(int y,int m,int d){
            int w=diff(y,m,d)%7;
            if(w==0){
                w=7;
            }
            return w;
        }
        //根据1日星期w，求第n个星期星期e
        private static int ml(int w,int n,int e){
            return 1+(n-1)*7+(7-w+e)%7;
        }
        //根据6月1日星期w 求5月最后一个星期一
        private static int ml2(int w){
            int d=(w==1?7:w-1);
            return 32-d;
        }
        public static void main(String[] args){
            Scanner sc=new Scanner(System.in);
            while(sc.hasNext()){
                int y=sc.nextInt();
                System.out.printf("%d-01-01\n",y);
                int w;
                w=week(y,1,1);
                System.out.printf("%d-01-%02d\n",y,ml(w,3,1));
                w=week(y,2,1);
                System.out.printf("%d-02-%02d\n",y,ml(w,3,1));
                w=week(y,6,1);
                System.out.printf("%d-05-%02d\n",y,ml2(w));
                System.out.printf("%d-07-04\n",y);
                w=week(y,9,1);
                System.out.printf("%d-09-%02d\n",y,ml(w,1,1));
                w=week(y,11,1);
                System.out.printf("%d-11-%02d\n",y,ml(w,4,4));
                System.out.printf("%d-12-25\n",y);
                System.out.println();

            }
        }
    }

